#/bin/sh

show_header() {
	adb shell "cat /proc/meminfo" | egrep "MemTotal|MemFree|Dirty|Writeback:|Cached:"|awk '{print $1}'|xargs -n1 -n2 -n3 -n4 -n5 -n6
}

show_body() {
	_arg=$(date "+%H:%M:%S.%3N\t")
	adb shell "cat /proc/meminfo" | egrep "MemTotal|MemFree|Dirty|Writeback:|Cached:"|awk '{print $2}'|xargs -n1 -n2 -n3 -n4 -n5 -n6| sed -e 's/^/'$_arg'/'
}

which_func() {
    while true; do show_body;sleep 1; done
}

show_header
which_func